package com.caius.xiaohashu.user.relation.biz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author Caius
 * @description
 * @since Created in 2025-05-22
 */
@Getter
@AllArgsConstructor
public enum LuaResultEnum {
    ZSET_NOT_EXIST(-1L),
    FOLLOW_LIMIT(-2L),
    ALREADY_FOLLOWED(-3L),
    NOT_FOLLOWED(-4L),
    FOLLOW_SUCCESS(0L);

    private final Long code;

    public static LuaResultEnum valueOf(Long code) {
        for (LuaResultEnum luaResultEnum : LuaResultEnum.values()) {
            if (luaResultEnum.code.equals(code)) {
                return luaResultEnum;
            }
        }
        return null;
    }
}
